package com.liaoyoule.multiple.api;


import com.liaoyoule.multiple.dao.page.PageInfo;
import com.liaoyoule.multiple.dto.UserDTO;
import com.liaoyoule.multiple.vm.LoginVM;
import io.swagger.annotations.*;
import org.springframework.http.HttpMessage;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-02-20T03:06:37.408Z")

@Api(value = "user", description = "the user API")
public interface UserApi {

    @ApiOperation(value = "", notes = "根据代码查询数据库具体信息", response = UserDTO.class, tags={ "user", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "successful operation", response = UserDTO.class),
        @ApiResponse(code = 400, message = "Invalid code supplied", response = UserDTO.class),
        @ApiResponse(code = 404, message = "Database not found", response = UserDTO.class) })
    @RequestMapping(value = "/user/{id}",
        method = RequestMethod.GET)
    ResponseEntity<UserDTO> getDatabaseByCode(@ApiParam(value = "id", required = true) @PathVariable("id") String id);


    @ApiOperation(value = "获取所有查询用户列表", notes = "", response = UserDTO.class, responseContainer = "List", tags={ "user", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "查询库数组", response = UserDTO.class),
        @ApiResponse(code = 200, message = "Unexpected error", response = UserDTO.class) })
    @RequestMapping(value = "/user",
        method = RequestMethod.GET)
    ResponseEntity getUsers(@ApiParam(value = "查询条件") @RequestParam(value = "queryConditon", required = false) String queryString,
                                               @ApiParam(value = "页码") @RequestParam(value = "pageNumber", required = false) Integer pageNumber,
                                               @ApiParam(value = "分页大小") @RequestParam(value = "pageSize", required = false) Integer pageSize,
                                               @ApiParam(value = "排序字段") @RequestParam(value = "orderBy", required = false) String orderBy,
                                               @ApiParam(value = "排序方式：desc  倒序， asc 升序") @RequestParam(value = "sort", required = false) String sort);


    @ApiOperation(value = "更新查询库", notes = "", response = HttpMessage.class, tags={ "user", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "successful operation", response = HttpMessage.class) })
    @RequestMapping(value = "/user/{id}",
        method = RequestMethod.PUT)
    ResponseEntity<ApiResponseMessage> updateUser(@ApiParam(value = "查询库代码", required = true) @PathVariable("id") String id);


    @ApiOperation(value = "", notes = "", response = HttpMessage.class, tags={ "user", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "（成功）  服务器已成功处理了请求。", response = HttpMessage.class),
        @ApiResponse(code = 400, message = "服务器不理解请求的语法", response = HttpMessage.class),
        @ApiResponse(code = 401, message = "没有权限", response = HttpMessage.class),
        @ApiResponse(code = 404, message = "服务器找不到请求的网页", response = HttpMessage.class),
        @ApiResponse(code = 500, message = "服务器遇到错误，无法完成请求", response = HttpMessage.class) })
    @RequestMapping(value = "/user/authority",
        method = RequestMethod.POST)
    ResponseEntity<ApiResponseMessage> userAuthorityPost(@ApiParam(value = "The login certificate JSON you want to post", required = true) @RequestBody LoginVM login);



    @ApiOperation(value = "", notes = "", response = HttpMessage.class, tags={ "user", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "（成功）  服务器已成功处理了请求。", response = HttpMessage.class),
            @ApiResponse(code = 400, message = "服务器不理解请求的语法", response = HttpMessage.class),
            @ApiResponse(code = 401, message = "没有权限", response = HttpMessage.class),
            @ApiResponse(code = 404, message = "服务器找不到请求的网页", response = HttpMessage.class),
            @ApiResponse(code = 500, message = "服务器遇到错误，无法完成请求", response = HttpMessage.class) })
    @RequestMapping(value = "/user/{id}",
            method = RequestMethod.DELETE)
    ResponseEntity<ApiResponseMessage> userDelete(@ApiParam(value ="1,2,3,4", required = true) @PathVariable("id") String id);




    @ApiOperation(value = "获取所有查询用户列表", notes = "", response = UserDTO.class, responseContainer = "List", tags={ "user", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "查询库数组", response = UserDTO.class),
            @ApiResponse(code = 200, message = "Unexpected error", response = UserDTO.class) })
    @RequestMapping(value = "/user/download",
            method = RequestMethod.POST)
    ResponseEntity userDownload(@ApiParam(value ="1,2,3,4", required = true) @RequestBody String id,HttpServletResponse response);


}
